package top.roud.scs.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import top.roud.scs.channel.OuputChannel;

/**
 * @description : TODO
 * @author: guangrui_hu
 * @date: 2023/1/11
 * @version:
 */
@Component
@EnableBinding(OuputChannel.class)
public class Sender {
    @Autowired
    private OuputChannel ouputChannel;

    public void send(String message) {
        final boolean send = ouputChannel.output().send(MessageBuilder.withPayload(message).build());
        System.out.println(send);
    }

}
